
//频道
angular.module('mamApp').factory('ChannelManager', ['$http','api', function ($http,api) {
    var ChannelManager = {
        /**
         * 一级频道列表
         * @param params
         * @returns
         */

        categoriesList: function () {
            return $http.get(api+'/cp/tags/categories').then(function (result) {
                return result;
            });
        },
        /**
         * 二级频道列表
         * @param params
         * @returns result
         */
        channelsList: function (categoryId) {
            return $http.get(api+'/cp/tags/channels/'+categoryId).then(function (result) {
                return result;
            });
        },
        /**
         * 通用标签
         * @param params
         * @returns result
         */
        commTagsList: function () {
            return $http.get(api+'/cp/tags/commtags').then(function (result) {
                return result;
            });
        },
        /**
         * 通用标签
         * @param params
         * @returns result
         */
        specialTagsList: function (channelId) {
            return $http.get(api+'/cp/tags/'+channelId+'/specialtags').then(function (result) {
                return result;
            });
        }


    };

    return ChannelManager;
}]);
